import Okay  from './Okay'
export default class Component {
    constructor (config) {
        this.ele = document.createElement('comp')
        this.ele.innerHTML =
            config.template instanceof Element
                ?config.template.innerHTML
                :config.template.startsWith('#')
                ?document.getElementById(config.template).innerHTML
                :config.template
        config.ele = this.ele
        this.okay = new Okay(config)
    }
    appendTo (ele) {
        let childsNode = this.okay.ele.ele.childNodes
        for (let child of childsNode) {
            ele.appendChild( this.okay.ele.ele)
        }
    }

}